package com.rnkrsoft.suyan.config.server.config.entity;

import com.rnkrsoft.framework.orm.PrimaryKey;
import com.rnkrsoft.framework.orm.jdbc.*;
import com.rnkrsoft.suyan.config.internal.enums.FileStatusEnum;
import com.rnkrsoft.suyan.config.internal.enums.YesOrNo;
import lombok.*;
/**
 * Created by woate on 2018/5/13.
 */
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ToString(callSuper = true)
@Table(name = "FILE_INFO", prefix = "TB")
@Comment("文件信息表")
public class FileInfoEntity extends BaseEntity {
    @PrimaryKey
    @StringColumn(name = "FILE_ID", nullable = false)
    @Comment("文件编号")
    String fileId;

    @StringColumn(name = "PROJECT_ID")
    @Comment("环境编号")
    String projectId;

    @StringColumn(name = "ENVIRONMENT_ID")
    @Comment("环境编号")
    String environmentId;

    @StringColumn(name = "MACHINE_ID")
    @Comment("机器编号")
    String machineId;

    @NumberColumn(name = "FILE_VERSION", defaultValue = "1")
    @Comment("文件版本，默认从1开始自增")
    Integer fileVersion;

    @StringColumn(name = "REAL_FILE_NAME")
    @Comment("文件完整名称, eg:/demo/test1/file.xls")
    String realFileName;

    @StringColumn(name = "FILE_PATH")
    @Comment("文件路径, eg:/demo/test1")
    String filePath;

    @StringColumn(name = "FILE_ENCRYPT", defaultValue = "2", enumClass = YesOrNo.class)
    @Comment("文件是否加密")
    String fileEncrypt;

    @StringColumn(name = "FILE_NAME")
    @Comment("文件名, eg:file")
    String fileName;

    @StringColumn(name = "FILE_SUFFIX")
    @Comment("文件后缀: eg:xls")
    String fileSuffix;

    @StringColumn(name = "FILE_FINGERPRINT")
    @Comment("文件指纹,SHA512签字")
    String fileFingerprint;

    @NumberColumn(name = "FILE_STATUS", defaultValue = "1", enumClass = FileStatusEnum.class)
    @Comment("文件状态,默认为正常 禁用，正常")
    Integer fileStatus;

    @StringColumn(name = "FILE_DESC")
    @Comment("文件描述")
    String fileDesc;
}
